package com.immunology.domain;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="COMPLAINT")
public class Complaint implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column(name="COMPLAINT_ID")
	private Long id;
	
	@Column(name="NAME", length = 50)
	private String name;
	
	@ManyToOne
	@JoinColumn(name="COMPLAINT_TYPE_ID")
	private ComplaintType complaintType;
	
/*	@ManyToOne
	@JoinColumn(name="SURVEY_ANSWER_ID")
	private SurveyAnswer surveyAnswer;*/
	
	@OneToMany(mappedBy="survey")
	private Collection<SurveyAnswer> surveyAnswers;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public ComplaintType getComplaintType() {
		return complaintType;
	}

	public void setComplaintType(ComplaintType complaintType) {
		this.complaintType = complaintType;
	}
	
/*	public SurveyAnswer getSurveyAnswer() {
		return surveyAnswer;
	}
	
	public void setSurveyAnswer(SurveyAnswer surveyAnswer) {
		this.surveyAnswer = surveyAnswer;
	}*/

	public Collection<SurveyAnswer> getSurveyAnswers() {
		return surveyAnswers;
	}

	public void setSurveyAnswers(Collection<SurveyAnswer> surveyAnswers) {
		this.surveyAnswers = surveyAnswers;
	}
}
